//
//  LYResumeTopPriceCell.m
//  SelectCity
//
//  Created by liuyan on 2019/3/28.
//  Copyright © 2019年 liuyan. All rights reserved.
//

#import "LYResumeTopPriceCell.h"

@interface LYResumeTopPriceCell()

@property (nonatomic, strong) UIImageView *selectImage;
@property (nonatomic, strong) UILabel *dayLabel;
@property (nonatomic, strong) UILabel *priceLabel;

@end

@implementation LYResumeTopPriceCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubViews];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

#pragma mark - InitSubViews
- (void)initSubViews{
    
    self.selectImage = [[UIImageView alloc] initWithFrame:CGRectMake(WIDTH -25, 25, 15, 15)];
    [self.contentView addSubview:self.selectImage];
    
    self.dayLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 10, self.selectImage.left - 20, 20)];
    self.dayLabel.font = [UIFont systemFontOfSize:13];
    self.dayLabel.textColor = RGB(34, 34, 34);
    [self.contentView addSubview:self.dayLabel];
    
    self.priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, self.dayLabel.bottom, self.selectImage.left - 20, 20)];
    self.priceLabel.font = [UIFont systemFontOfSize:13];
    self.priceLabel.textColor = [UIColor orangeColor];
    [self.contentView addSubview:self.priceLabel];
    
    UIView *lineview = [[UIView alloc] initWithFrame:CGRectMake(0, 64, WIDTH, 1)];
    lineview.backgroundColor = RGB(247, 247, 247);
    [self.contentView addSubview:lineview];
}

-(void)setModel:(LYResumePriceModel *)model{
    if (model.isSelected) {
       _selectImage.image = [UIImage imageNamed:@"privacysetting_main_s"];
    }else{
        _selectImage.image = [UIImage imageNamed:@"privacysetting_main_n"];
    }
    _dayLabel.text = [NSString stringWithFormat:@"%li天",model.day];
    _priceLabel.text = [NSString stringWithFormat:@"%.1f元",model.price];
}

-(void)setJobmodel:(LYJobHuntingModel *)jobmodel{
    if (jobmodel.isSelected) {
        _selectImage.image = [UIImage imageNamed:@"privacysetting_main_s"];
    }else{
        _selectImage.image = [UIImage imageNamed:@"privacysetting_main_n"];
    }
    _dayLabel.text = jobmodel.name;
    _priceLabel.text = [NSString stringWithFormat:@"%li聘豆",jobmodel.price];
}

@end
